<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>Sifteo SDK: Sifteo::AssetLoader Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-style-overrides.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<center>
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Sifteo SDK" src="sdk_logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">
   &#160;<span id="projectnumber">v1.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
</center>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Home</span></a></li>
      <li><a href="pages.html"><span>Guides</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>Sifteo</b></li><li class="navelem"><a class="el" href="struct_sifteo_1_1_asset_loader.html">AssetLoader</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="struct_sifteo_1_1_asset_loader-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Sifteo::AssetLoader Struct Reference<div class="ingroups"><a class="el" href="group__assets.html">Assets</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>An <a class="el" href="struct_sifteo_1_1_asset_loader.html" title="An AssetLoader coordinates asset loading operations on one or more cubes.">AssetLoader</a> coordinates asset loading operations on one or more cubes.  
 <a href="struct_sifteo_1_1_asset_loader.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="loader_8h_source.html">sifteo/asset/loader.h</a>&gt;</code></p>

<p>Inherited by <a class="el" href="class_sifteo_1_1_scoped_asset_loader.html">Sifteo::ScopedAssetLoader</a>.</p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:af927e1d9a6262e065aeecf4e70583523"><td class="memItemLeft" align="right" valign="top">unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_asset_loader.html#af927e1d9a6262e065aeecf4e70583523">averageProgress</a> (unsigned max) const </td></tr>
<tr class="memdesc:af927e1d9a6262e065aeecf4e70583523"><td class="mdescLeft">&#160;</td><td class="mdescRight">Measures total progress on all cubes, as an integer.  <a href="#af927e1d9a6262e065aeecf4e70583523">More...</a><br/></td></tr>
<tr class="separator:af927e1d9a6262e065aeecf4e70583523"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab16b393889cc5e90e923ff5bd09b3c99"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_asset_loader.html#ab16b393889cc5e90e923ff5bd09b3c99">averageProgress</a> () const </td></tr>
<tr class="memdesc:ab16b393889cc5e90e923ff5bd09b3c99"><td class="mdescLeft">&#160;</td><td class="mdescRight">Measures total progress on all cubes, as a floating point value.  <a href="#ab16b393889cc5e90e923ff5bd09b3c99">More...</a><br/></td></tr>
<tr class="separator:ab16b393889cc5e90e923ff5bd09b3c99"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a966718ecff9ee023aaf1228a82984965"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a966718ecff9ee023aaf1228a82984965"></a>
_SYSCubeIDVector&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_asset_loader.html#a966718ecff9ee023aaf1228a82984965">busyCubes</a> () const </td></tr>
<tr class="memdesc:a966718ecff9ee023aaf1228a82984965"><td class="mdescLeft">&#160;</td><td class="mdescRight">Which cubes are still busy loading? <br/></td></tr>
<tr class="separator:a966718ecff9ee023aaf1228a82984965"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4372641ecdcf784d60c1f9a92b4ef2d1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_asset_loader.html#a4372641ecdcf784d60c1f9a92b4ef2d1">cancel</a> (_SYSCubeIDVector cubes=-1)</td></tr>
<tr class="memdesc:a4372641ecdcf784d60c1f9a92b4ef2d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">End any in-progress asset loading operations without finishing them.  <a href="#a4372641ecdcf784d60c1f9a92b4ef2d1">More...</a><br/></td></tr>
<tr class="separator:a4372641ecdcf784d60c1f9a92b4ef2d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a41d98f45a91f5336d52c7d062c9a31d3"><td class="memItemLeft" align="right" valign="top">unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_asset_loader.html#a41d98f45a91f5336d52c7d062c9a31d3">cubeProgress</a> (_SYSCubeID cubeID, unsigned max) const </td></tr>
<tr class="memdesc:a41d98f45a91f5336d52c7d062c9a31d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Measures progress on a single cube, as an integer.  <a href="#a41d98f45a91f5336d52c7d062c9a31d3">More...</a><br/></td></tr>
<tr class="separator:a41d98f45a91f5336d52c7d062c9a31d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a054be6b34ccf69c5241bf60798224048"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_asset_loader.html#a054be6b34ccf69c5241bf60798224048">cubeProgress</a> (_SYSCubeID cubeID) const </td></tr>
<tr class="memdesc:a054be6b34ccf69c5241bf60798224048"><td class="mdescLeft">&#160;</td><td class="mdescRight">Measures progress on a single cube, as a floating point value.  <a href="#a054be6b34ccf69c5241bf60798224048">More...</a><br/></td></tr>
<tr class="separator:a054be6b34ccf69c5241bf60798224048"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a349fbf02cb0acbeca90f25cb47ddf05f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_asset_loader.html#a349fbf02cb0acbeca90f25cb47ddf05f">finish</a> ()</td></tr>
<tr class="memdesc:a349fbf02cb0acbeca90f25cb47ddf05f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Ensure that the system is no longer using this <a class="el" href="struct_sifteo_1_1_asset_loader.html" title="An AssetLoader coordinates asset loading operations on one or more cubes.">AssetLoader</a> object.  <a href="#a349fbf02cb0acbeca90f25cb47ddf05f">More...</a><br/></td></tr>
<tr class="separator:a349fbf02cb0acbeca90f25cb47ddf05f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afed2ef66084d236ee30f44ff961eede5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_asset_loader.html#afed2ef66084d236ee30f44ff961eede5">init</a> ()</td></tr>
<tr class="memdesc:afed2ef66084d236ee30f44ff961eede5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize this object.  <a href="#afed2ef66084d236ee30f44ff961eede5">More...</a><br/></td></tr>
<tr class="separator:afed2ef66084d236ee30f44ff961eede5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae4b462cf20b7c5b24bb273a8bc6a59d0"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_asset_loader.html#ae4b462cf20b7c5b24bb273a8bc6a59d0">isComplete</a> (_SYSCubeIDVector vec) const </td></tr>
<tr class="memdesc:ae4b462cf20b7c5b24bb273a8bc6a59d0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Is the asset install finished for all cubes in the specified vector?  <a href="#ae4b462cf20b7c5b24bb273a8bc6a59d0">More...</a><br/></td></tr>
<tr class="separator:ae4b462cf20b7c5b24bb273a8bc6a59d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9013f054ed031bffb47b634b3bbe34a6"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_asset_loader.html#a9013f054ed031bffb47b634b3bbe34a6">isComplete</a> (_SYSCubeID cubeID) const </td></tr>
<tr class="memdesc:a9013f054ed031bffb47b634b3bbe34a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Is the asset install for "cubeID" finished?  <a href="#a9013f054ed031bffb47b634b3bbe34a6">More...</a><br/></td></tr>
<tr class="separator:a9013f054ed031bffb47b634b3bbe34a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a507c2d0a96392489997209862c3113ce"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a507c2d0a96392489997209862c3113ce"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_asset_loader.html#a507c2d0a96392489997209862c3113ce">isComplete</a> () const </td></tr>
<tr class="memdesc:a507c2d0a96392489997209862c3113ce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Are all asset installations from this asset loading session complete? <br/></td></tr>
<tr class="separator:a507c2d0a96392489997209862c3113ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab7347988a1d72ff7ddef19e0074a45f1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab7347988a1d72ff7ddef19e0074a45f1"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_asset_loader.html#ab7347988a1d72ff7ddef19e0074a45f1">operator const _SYSAssetLoader &amp;</a> () const </td></tr>
<tr class="memdesc:ab7347988a1d72ff7ddef19e0074a45f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Implicit conversion to system object. <br/></td></tr>
<tr class="separator:ab7347988a1d72ff7ddef19e0074a45f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab1e40dc5484cb0f363b283d983e9467f"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ab1e40dc5484cb0f363b283d983e9467f"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_asset_loader.html#ab1e40dc5484cb0f363b283d983e9467f">start</a> (T &amp;configuration, _SYSCubeIDVector cubes=-1)</td></tr>
<tr class="memdesc:ab1e40dc5484cb0f363b283d983e9467f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start installing an <a class="el" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration</a>.  <a href="#ab1e40dc5484cb0f363b283d983e9467f">More...</a><br/></td></tr>
<tr class="separator:ab1e40dc5484cb0f363b283d983e9467f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>An <a class="el" href="struct_sifteo_1_1_asset_loader.html" title="An AssetLoader coordinates asset loading operations on one or more cubes.">AssetLoader</a> coordinates asset loading operations on one or more cubes. </p>
<p>An <a class="el" href="struct_sifteo_1_1_asset_loader.html" title="An AssetLoader coordinates asset loading operations on one or more cubes.">AssetLoader</a> may be a transient object; it only needs to exist when an asset loading operation is taking place, and can be deleted or recycled afterwards. AssetLoaders can be allocated on the stack, or as part of a union.</p>
<p>A single <a class="el" href="struct_sifteo_1_1_asset_loader.html" title="An AssetLoader coordinates asset loading operations on one or more cubes.">AssetLoader</a> can load any combination of <a class="el" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration</a> objects concurrently to any number of cubes, up to the defined CUBE_ALLOCATION. Each <a class="el" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration</a> operates on its own <a class="el" href="class_sifteo_1_1_cube_set.html" title="An unordered set of cubes.">CubeSet</a>, such that a different <a class="el" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration</a> may be loaded on each cube, or any combination of cubes.</p>
<p><b>Single <a class="el" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration</a> Example</b> </p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;assets.gen.h&quot;</span></div>
<div class="line"><span class="keyword">using namespace </span>Sifteo;</div>
<div class="line"></div>
<div class="line"><span class="comment">// allocate a slot into which our assets will be loaded</span></div>
<div class="line"><span class="keyword">static</span> <a class="code" href="class_sifteo_1_1_asset_slot.html" title="AssetSlots are numbered containers, in a cube&#39;s flash memory, which can hold AssetGroups.">AssetSlot</a> MenuSlot = <a class="code" href="class_sifteo_1_1_asset_slot.html#ac1a4535a9092c9c82b546871c63b168b" title="Statically allocate a new AssetSlot.">AssetSlot::allocate</a>();</div>
<div class="line"></div>
<div class="line"><span class="comment">// assume assets.gen.h provides a Sifteo::AssetGroup called MenuGroup</span></div>
<div class="line"></div>
<div class="line"><a class="code" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration&lt;1&gt;</a> config;</div>
<div class="line">config.<a class="code" href="class_sifteo_1_1_asset_configuration.html#aded2e668733f1d331927813244a2c264" title="Add an AssetGroup to this configuration.">append</a>(MenuSlot, MenuGroup);</div>
<div class="line"></div>
<div class="line"><span class="comment">// load a single configuration to the set of all connected cubes</span></div>
<div class="line"><a class="code" href="struct_sifteo_1_1_asset_loader.html" title="An AssetLoader coordinates asset loading operations on one or more cubes.">AssetLoader</a> loader;</div>
<div class="line">loader.<a class="code" href="struct_sifteo_1_1_asset_loader.html#afed2ef66084d236ee30f44ff961eede5" title="Initialize this object.">init</a>();</div>
<div class="line">loader.start(config, <a class="code" href="class_sifteo_1_1_cube_set.html#ae4e5e450846b0a6c655705249b6112be" title="Return a CubeSet containing all connected cubes which are visible to the current application.">CubeSet::connected</a>());</div>
<div class="line"></div>
<div class="line"><span class="comment">// and wait until the load is complete</span></div>
<div class="line"><span class="comment">// NOTE - it is also possible to poll for completion using AssetLoader::isComplete()</span></div>
<div class="line">loader.finish();</div>
</div><!-- fragment --><p><b>Multiple <a class="el" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration</a> Example</b> </p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;assets.gen.h&quot;</span></div>
<div class="line"><span class="keyword">using namespace </span>Sifteo;</div>
<div class="line"></div>
<div class="line"><span class="keyword">static</span> <a class="code" href="class_sifteo_1_1_asset_slot.html" title="AssetSlots are numbered containers, in a cube&#39;s flash memory, which can hold AssetGroups.">AssetSlot</a> MenuSlot = <a class="code" href="class_sifteo_1_1_asset_slot.html#ac1a4535a9092c9c82b546871c63b168b" title="Statically allocate a new AssetSlot.">AssetSlot::allocate</a>();</div>
<div class="line"><span class="keyword">static</span> <a class="code" href="class_sifteo_1_1_asset_slot.html" title="AssetSlots are numbered containers, in a cube&#39;s flash memory, which can hold AssetGroups.">AssetSlot</a> AnimationSlot = <a class="code" href="class_sifteo_1_1_asset_slot.html#ac1a4535a9092c9c82b546871c63b168b" title="Statically allocate a new AssetSlot.">AssetSlot::allocate</a>();</div>
<div class="line"></div>
<div class="line"><span class="comment">// assume assets.gen.h provides two Sifteo::AssetGroup objects</span></div>
<div class="line"><span class="comment">// called MenuGroup and AnimationGroup</span></div>
<div class="line"></div>
<div class="line"><a class="code" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration&lt;1&gt;</a> menuConfig;</div>
<div class="line">menuConfig.<a class="code" href="class_sifteo_1_1_asset_configuration.html#aded2e668733f1d331927813244a2c264" title="Add an AssetGroup to this configuration.">append</a>(MenuSlot, MenuGroup);</div>
<div class="line"></div>
<div class="line"><a class="code" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration&lt;1&gt;</a> animationConfig;</div>
<div class="line">animationConfig.<a class="code" href="class_sifteo_1_1_asset_configuration.html#aded2e668733f1d331927813244a2c264" title="Add an AssetGroup to this configuration.">append</a>(AnimationSlot, AnimationGroup);</div>
<div class="line"></div>
<div class="line"><a class="code" href="struct_sifteo_1_1_asset_loader.html" title="An AssetLoader coordinates asset loading operations on one or more cubes.">AssetLoader</a> loader;</div>
<div class="line">loader.<a class="code" href="struct_sifteo_1_1_asset_loader.html#afed2ef66084d236ee30f44ff961eede5" title="Initialize this object.">init</a>();</div>
<div class="line"></div>
<div class="line"><span class="comment">// load menuConfig to cubes 0 and 1</span></div>
<div class="line"><a class="code" href="class_sifteo_1_1_cube_set.html" title="An unordered set of cubes.">CubeSet</a> cubeset01(0, 2);</div>
<div class="line">loader.start(menuConfig, cubeset01);</div>
<div class="line"></div>
<div class="line"><span class="comment">// load animationConfig to cubes 2 and 3</span></div>
<div class="line"><a class="code" href="class_sifteo_1_1_cube_set.html" title="An unordered set of cubes.">CubeSet</a> cubeset23(2, 4);</div>
<div class="line">loader.start(animationConfig, cubeset23);</div>
<div class="line"></div>
<div class="line">loader.finish();</div>
</div><!-- fragment --> </div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="af927e1d9a6262e065aeecf4e70583523"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">unsigned Sifteo::AssetLoader::averageProgress </td>
          <td>(</td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>max</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Measures total progress on all cubes, as an integer. </p>
<p>This measures loading progress for all cubes, returning a number between 0 and 'max'. If all cubes are done loading, this returns 'max'. If the loading has not yet made any progress or no loading was necessary, returns zero.</p>
<p>This calculates using 32-bit integer math, and 'max' multiplied by the number of bytes of uncompressed asset data must not overflow the 32-bit type. </p>

</div>
</div>
<a class="anchor" id="ab16b393889cc5e90e923ff5bd09b3c99"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">float Sifteo::AssetLoader::averageProgress </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Measures total progress on all cubes, as a floating point value. </p>
<p>This measures loading progress for all cubes, returning a number between 0.0f and 1.0f. If all cubes are done loading, this returns 1.0f. If the loading has not yet made any progress, returns 0.0f. If no loading was necessary, returns NaN. </p>

</div>
</div>
<a class="anchor" id="a4372641ecdcf784d60c1f9a92b4ef2d1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Sifteo::AssetLoader::cancel </td>
          <td>(</td>
          <td class="paramtype">_SYSCubeIDVector&#160;</td>
          <td class="paramname"><em>cubes</em> = <code>-1</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>End any in-progress asset loading operations without finishing them. </p>
<p>This function is similar to <a class="el" href="struct_sifteo_1_1_asset_loader.html#a349fbf02cb0acbeca90f25cb47ddf05f" title="Ensure that the system is no longer using this AssetLoader object.">finish()</a>, except that any in-progress asset loading operations do not finish. Instead, any asset slots written to since the last <a class="el" href="struct_sifteo_1_1_asset_loader.html#a349fbf02cb0acbeca90f25cb47ddf05f" title="Ensure that the system is no longer using this AssetLoader object.">finish()</a> will be in an indeterminate state, and the slot must be erased before any further loading may be attempted.</p>
<p>By default, this cancels all in-progress load operations. A <a class="el" href="class_sifteo_1_1_cube_set.html" title="An unordered set of cubes.">CubeSet</a> may be specified, to cancel only the indicated cubes.</p>
<p>If a load is cancelled, the group that was being loaded will not be available, but pre-existing groups will still be usable. However, further load operations on that <a class="el" href="class_sifteo_1_1_asset_slot.html" title="AssetSlots are numbered containers, in a cube&#39;s flash memory, which can hold AssetGroups.">AssetSlot</a> will not be possible until the slot is erased. It is said that a slot in this post-cancellation state is <em>indeterminate</em> until it is erased. </p>

</div>
</div>
<a class="anchor" id="a41d98f45a91f5336d52c7d062c9a31d3"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">unsigned Sifteo::AssetLoader::cubeProgress </td>
          <td>(</td>
          <td class="paramtype">_SYSCubeID&#160;</td>
          <td class="paramname"><em>cubeID</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>max</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Measures progress on a single cube, as an integer. </p>
<p>This measures just the loading progress for a single cube, returning a number between 0 and 'max'. If the cube is done loading, this returns 'max'. If the cube hasn't started loading or has no need to load assets, returns zero.</p>
<p>This calculates using 32-bit integer math, and 'max' multiplied by the number of bytes of uncompressed asset data must not overflow the 32-bit type. </p>

</div>
</div>
<a class="anchor" id="a054be6b34ccf69c5241bf60798224048"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">float Sifteo::AssetLoader::cubeProgress </td>
          <td>(</td>
          <td class="paramtype">_SYSCubeID&#160;</td>
          <td class="paramname"><em>cubeID</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Measures progress on a single cube, as a floating point value. </p>
<p>This measures just the loading progress for a single cube, returning a number between 0.0f and 1.0f. If the cube is done loading, this returns 1.0f. If the cube hasn't started loading or has no need to load assets, returns 0.0f. </p>

</div>
</div>
<a class="anchor" id="a349fbf02cb0acbeca90f25cb47ddf05f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Sifteo::AssetLoader::finish </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Ensure that the system is no longer using this <a class="el" href="struct_sifteo_1_1_asset_loader.html" title="An AssetLoader coordinates asset loading operations on one or more cubes.">AssetLoader</a> object. </p>
<p>If any loads are still in progress, this function blocks until they complete. This must be called after an asset load is done, before the <a class="el" href="struct_sifteo_1_1_asset_loader.html" title="An AssetLoader coordinates asset loading operations on one or more cubes.">AssetLoader</a> object itself is deallocated or recycled.</p>
<p>If <a class="el" href="struct_sifteo_1_1_asset_loader.html#a349fbf02cb0acbeca90f25cb47ddf05f" title="Ensure that the system is no longer using this AssetLoader object.">finish()</a> has already been called, has no effect. </p>

</div>
</div>
<a class="anchor" id="afed2ef66084d236ee30f44ff961eede5"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Sifteo::AssetLoader::init </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Initialize this object. </p>
<p>This is made explicit, rather than using a constructor, so that games can keep <a class="el" href="struct_sifteo_1_1_asset_loader.html" title="An AssetLoader coordinates asset loading operations on one or more cubes.">AssetLoader</a> in a union if necessary to save memory.</p>
<p>Must be called once, prior to any calls to <a class="el" href="struct_sifteo_1_1_asset_loader.html#ab1e40dc5484cb0f363b283d983e9467f" title="Start installing an AssetConfiguration.">start()</a>. </p>

</div>
</div>
<a class="anchor" id="ae4b462cf20b7c5b24bb273a8bc6a59d0"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool Sifteo::AssetLoader::isComplete </td>
          <td>(</td>
          <td class="paramtype">_SYSCubeIDVector&#160;</td>
          <td class="paramname"><em>vec</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Is the asset install finished for all cubes in the specified vector? </p>
<p>This only returns 'true' when the install is completely done on all of these cubes.</p>
<p>Note that this is more efficient than calling <a class="el" href="struct_sifteo_1_1_asset_group.html#a5fc86e767b5dbe949a7acd43f5ff9cf7" title="Is this AssetGroup installed on all cubes in the given vector?">AssetGroup::isInstalled</a>. Whereas isInstalled() needs to look for the <a class="el" href="struct_sifteo_1_1_asset_group.html" title="A bundle of compressed tile data, for use by AssetImages.">AssetGroup</a> in the system's cache, this function is simply checking whether the current installation session has completed. </p>

</div>
</div>
<a class="anchor" id="a9013f054ed031bffb47b634b3bbe34a6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool Sifteo::AssetLoader::isComplete </td>
          <td>(</td>
          <td class="paramtype">_SYSCubeID&#160;</td>
          <td class="paramname"><em>cubeID</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Is the asset install for "cubeID" finished? </p>
<p>Returns true only when the install is completely done on this cube. </p>

</div>
</div>
<a class="anchor" id="ab1e40dc5484cb0f363b283d983e9467f"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Sifteo::AssetLoader::start </td>
          <td>(</td>
          <td class="paramtype">T &amp;&#160;</td>
          <td class="paramname"><em>configuration</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">_SYSCubeIDVector&#160;</td>
          <td class="paramname"><em>cubes</em> = <code>-1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Start installing an <a class="el" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration</a>. </p>
<p>This uses an <a class="el" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration</a> object to describe a set of AssetGroups which should be made available, and the slots to install each into. The <a class="el" href="struct_sifteo_1_1_asset_loader.html" title="An AssetLoader coordinates asset loading operations on one or more cubes.">AssetLoader</a> object will automatically erase any slots that need to be erased before starting, and it will calculate progress.</p>
<p>By default, the <a class="el" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration</a> is installed on to all cubes that are currently connected, and any cubes which connect prior to the other cubes completing their loads. This will load the same <a class="el" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration</a> on all cubes.</p>
<p>A <a class="el" href="class_sifteo_1_1_cube_set.html" title="An unordered set of cubes.">CubeSet</a> can be specified to restrict this load to only some of the available cubes. This can also be used to load different AssetConfigurations on different subsets of the available cubes.</p>
<p>The provided <a class="el" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration</a> must be valid, in that it must be possible to load all indicated AssetGroups in the indicated slots. If space is exhausted due to groups not mentioned in the <a class="el" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration</a>, the <a class="el" href="struct_sifteo_1_1_asset_loader.html" title="An AssetLoader coordinates asset loading operations on one or more cubes.">AssetLoader</a> will automatically erase the slot and reload only necessary groups. However, if space is exhausted solely due to groups mentioned in the <a class="el" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration</a>, this indicates that the <a class="el" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration</a> is invalid.</p>
<p>An <a class="el" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration</a> which is invalid or which does not match the corresponding <a class="el" href="struct_sifteo_1_1_asset_group.html" title="A bundle of compressed tile data, for use by AssetImages.">AssetGroup</a> header will cause a fault.</p>
<p>The system does not copy the <a class="el" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration</a>, it refers to it by address. As a consequence, it is vital that your <a class="el" href="class_sifteo_1_1_asset_configuration.html" title="An AssetConfiguration represents an arrangement of AssetGroups to load.">AssetConfiguration</a> instance stays in scope until you call <a class="el" href="struct_sifteo_1_1_asset_loader.html#a349fbf02cb0acbeca90f25cb47ddf05f" title="Ensure that the system is no longer using this AssetLoader object.">AssetLoader::finish()</a>, or until after your <a class="el" href="class_sifteo_1_1_scoped_asset_loader.html" title="An AssetLoader subclass which automatically calls init() and finish() in the constructor and destruct...">ScopedAssetLoader</a> goes out of scope. </p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="loader_8h_source.html">loader.h</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
    <hr class="footer"/>
    <address class="footer">
        <p><a href="http://sifteo.com">Sifteo</a> SDK v1.0.0 <small>(see <a href="https://developers.sifteo.com/sifteosdk">all versions</a>)</small></p>
        <p>Last updated Wed Mar 27 2013, by <a href="http://www.stack.nl/~dimitri/doxygen">Doxygen</a></p>
    </address>
</body>
</html>
